//导入mongoose模块
const mongoose = require('mongoose');
//商品schema对象
let productSchema = new mongoose.Schema({
    mvo_id: { type: String, require: true },
    name: { type: String, require: true },
    price: { type: Number, require: true, min: 0 },
    description: { type: String },
    category: { type: String, require: true },
    stock: { type: Number, require: true, min: 0 },
    image_url: { type: String, require: true },
    rating: { type: Number, require: true },
    valid: { type: Boolean, require: true },
})
let productModule = mongoose.model('product', productSchema)
module.exports = productModule